package cz.muni.fi.pa165.utils;

import cz.muni.fi.pa165.dto.MushroomDTO;
import cz.muni.fi.pa165.entity.Mushroom;

/**
 *
 * @author Matej Cimbora
 */
public class MushroomObjectTransformer {

    private MushroomObjectTransformer() {
    }

    public static Mushroom mushroomDTOToMushroom(MushroomDTO mushroomDTO) {
        Mushroom mushroom = new Mushroom();
        mushroom.setId(mushroomDTO.getId());
        mushroom.setName(mushroomDTO.getName());
        mushroom.setOccurenceFrom(mushroomDTO.getOccurenceFrom());
        mushroom.setOccurenceTo(mushroomDTO.getOccurenceTo());
        mushroom.setType(mushroomDTO.getType());
        return mushroom;
    }

    public static MushroomDTO mushroomToMushroomDTO(Mushroom mushroom) {
        MushroomDTO mushroomDTO = new MushroomDTO();
        mushroomDTO.setId(mushroom.getId());
        mushroomDTO.setName(mushroom.getName());
        mushroomDTO.setOccurenceFrom(mushroom.getOccurenceFrom());
        mushroomDTO.setOccurenceTo(mushroom.getOccurenceTo());
        mushroomDTO.setType(mushroom.getType());
        return mushroomDTO;
    }
}
